package zyn_hy_login;

public class mkCheck
{
	private HttpResponse httpR;
	private String strProNums;

	public mkCheck(HttpSessionState nowSession, HttpResponse hR, String strMknum)
	{
		if (nowSession.getItem("aspuid") == null)
		{
			hR.Redirect("/z8/alert.aspx?z8_alert=login");
		}
		else
		{
			this.httpR = hR;
			this.strProNums = "";
			if (nowSession.getItem("mkCheck" + strMknum) != null)
			{
				this.strProNums = nowSession.getItem("mkCheck" + strMknum);
			}
			else
			{
				String text = nowSession.getItem("aspuid").toString();
				String text2 = "select distinct pro.num";
				String text3 = text2 + " from z8_pro pro,role_pro rp,user_role ur ";
				for (DataRow row : DBCommon.getDataBySqluniquetempvar.Tables[0].Rows)
				{
					if (this.strProNums.equals(""))
					{
						this.strProNums = row.getItem("num").toString();
						continue;
					}
					this.strProNums = this.strProNums + "," + row.getItem("num").toString();
				}
				nowSession.Add("mkCheck" + strMknum, this.strProNums);
			}
		}
	}

	public final void CheckPopedom(String proNum)
	{
		if (this.strProNums.indexOf(proNum) == -1)
		{
			this.httpR.Redirect("/z8/alert.aspx?z8_alert=nomk");
		}
	}
}